<?php
require_once '../sub/init.php';
header("Cache-control: private");
require_once 'chkUadm.php';
if(!in_array('cert',$QXARR))exit(noauth());
require_once ZEAI.'cache/udata.php';
require_once ZEAI.'sub/zeai_up_func.php';
$rz_data=explode(',',$_ZEAI['rz_data']);
switch ($submitok) {
	case"identitynum_update":
		$rt=$db->query("SELECT uid,jsonstr FROM ".__TBL_SHALOU__.$SQL);
		$total = $db->num_rows($rt);
		if ($total > 0) {
			for($i=1;$i<=$total;$i++) {
				$rows = $db->fetch_array($rt,'name');
				if(!$rows) break;
				$uid            = $rows['uid'];
				$sl_row         = json_decode($rows['jsonstr'],true);
				$sl_identitynum = $sl_row['identitynum'];
				$row = $db->ROW(__TBL_USER__,"identitynum","id=".$uid,"name");
				if ($row){
					$data_identitynum = $row['identitynum'];
					if(!empty($sl_identitynum) && !empty($data_identitynum))continue;
					if(!empty($sl_identitynum) &&  empty($data_identitynum)){
						$db->query("UPDATE ".__TBL_USER__." SET identitynum='$sl_identitynum' WHERE id=".$uid);
					}elseif(empty($sl_identitynum) &&  !empty($data_identitynum)){
						$sl_row['identitynum'] = $data_identitynum;
						$jsonstr=encode_json($sl_row);
						$db->query("UPDATE ".__TBL_SHALOU__." SET jsonstr='$jsonstr' WHERE uid=".$uid);
					}
				}
			}
		}
	break;
	case"truename_update":
		$rt=$db->query("SELECT uid,jsonstr FROM ".__TBL_SHALOU__.$SQL);
		$total = $db->num_rows($rt);
		if ($total > 0) {
			for($i=1;$i<=$total;$i++) {
				$rows = $db->fetch_array($rt,'name');
				if(!$rows) break;
				$uid            = $rows['uid'];
				$sl_row         = json_decode($rows['jsonstr'],true);
				$sl_truename    = $sl_row['truename'];
				$row = $db->ROW(__TBL_USER__,"truename","id=".$uid,"name");
				if ($row){
					$data_truename = $row['truename'];
					if(!empty($sl_truename) && !empty($data_truename))continue;
					if(!empty($sl_truename) &&  empty($data_truename)){
						$db->query("UPDATE ".__TBL_USER__." SET truename='$sl_truename' WHERE id=".$uid);
					}elseif(empty($sl_truename) &&  !empty($data_truename)){
						$sl_row['truename'] = $data_truename;
						$jsonstr=encode_json($sl_row);
						$db->query("UPDATE ".__TBL_SHALOU__." SET jsonstr='$jsonstr' WHERE uid=".$uid);
					}
				}
			}
		}
	break;
	case"flag1":
		if(empty($list))json_exit(array('flag'=>0,'msg'=>'请选择您要审核的信息'));
		if(!is_array($list))exit(JSON_ERROR);
		if(count($list)>=1){
			foreach($list as $id){$id=intval($id);
				//
				if ($row = $db->ROW(__TBL_RZ__,"uid,path_b,path_b2,rzid,content","id=".$id)){
					$uid = intval($row[0]);$path_b = $row[1];$path_b2 = $row[2];$rzid = $row[3];$content = trimhtml($row[4]);
				}else{continue;}
				//
				$row = $db->ROW(__TBL_USER__,"nickname,openid,subscribe,RZ","id=".$uid,"num");
				if ($row){
					$data_nickname = dataIO($row[0],'out');$data_openid = $row[1];$data_subscribe = $row[2];$data_RZ = $row[3];
					//
					$RZ = explode(',',$data_RZ);
					if (empty($RZ) || count($RZ)<=0 || empty($data_RZ)){
						$db->query("UPDATE ".__TBL_USER__." SET RZ='$rzid' WHERE id=".$uid);
					}else{
						$SQL="";
						if (!in_array($rzid,$RZ)){
							$RZ[]=$rzid;
							$list = implode(',',$RZ);
							$SQL = ",RZ='$list'";
						}
						//
						if($rzid=='identity' || $rzid=='photo'){
							$row_shalou=shalou_data($uid);
							$birthday = getSFZbirthday($row_shalou['identitynum']);
							if(ifdate($birthday)){
								$SQL .= ",birthday='".$birthday."'";
							}
							if(!empty($row_shalou['truename'])){
								$SQL .= ",truename='".$row_shalou['truename']."'";
							}
							if(ifsfz($row_shalou['identitynum'])){
								$SQL .= ",identitynum='".$row_shalou['identitynum']."'";
							}
						}elseif($rzid=='weixin' && !empty($content)){
							$row_shalou=shalou_data($uid);
							$row_shalou['weixin'] = $content;
							$jsonstr=encode_json($row_shalou);
							$db->query("UPDATE ".__TBL_SHALOU__." SET jsonstr='$jsonstr' WHERE uid=".$uid);
							$SQL .= ",weixin='".$content."'";
						}
						//
						if(!empty($SQL)){
							$SQL = ltrim($SQL,',');
							$db->query("UPDATE ".__TBL_USER__." SET ".$SQL." WHERE id=".$uid);
						}
					}
					$db->query("UPDATE ".__TBL_RZ__." SET flag=1 WHERE id=".$id);
					//
					AddLog('【认证审核】用户【'.$data_nickname.'（uid:'.$uid.'）】->【'.RZtitle($rzid).'】->通过');
					//站内消息
					$C = '恭喜你！'.RZtitle($rzid).'认证审核已通过';
					$db->SendTip($uid,$C,dataIO($C,'in'),'sys');
					
					//微信模版
					if (!empty($data_openid) && $data_subscribe==1){
						//审核通过提醒
						$keyword1 = urlencode(RZtitle($rzid));
						$keyword2 = urlencode('已通过');
						$remark   = urlencode('已点亮'.RZtitle($rzid).'认证图标');
						$url      = urlencode(a('{"kind":"cert","mp":"m"}'));
						@wx_mb_sent('mbbh=ZEAI_HONOR_CHECK&openid='.$data_openid.'&flag=1&keyword1='.$keyword1.'&keyword2='.$keyword2.'&first='.$first.'&remark='.$remark.'&url='.$url);
					}
				}
			}
		}
		json_exit(array('flag'=>1,'msg'=>'审核成功'));
	break;
	case"flag0":
		if(empty($list))json_exit(array('flag'=>0,'msg'=>'请选择您要驳回的信息'));
		if(!is_array($list))exit(JSON_ERROR);
		if(count($list)>=1){
			foreach($list as $id){$id=intval($id);
				//
				$row = $db->ROW(__TBL_RZ__,"uid,path_b,path_b2,rzid"," id=".$id,"num");
				if ($row){
					$uid = intval($row[0]);$path_b = $row[1];$path_b2 = $row[2];$rzid = $row[3];
				}else{exit(JSON_ERROR);}
				//
				$row = $db->ROW(__TBL_USER__,"nickname,openid,subscribe,RZ,rz_num","id=".$uid,"num");
				if ($row){
					$data_nickname = dataIO($row[0],'out');$data_openid = $row[1];$data_subscribe = $row[2];
					$RZ = $row[3];$data_rz_num = $row[4];
					$RZ=explode(',',$RZ);
					if(is_array($RZ) && count($RZ)>0){
						foreach ($RZ as $key=>$value){
							if ($value === $rzid)unset($RZ[$key]);
						}
						$RZ = implode(",",$RZ);
					}else{
						$RZ = '';	
					}
					//$SQL = ($data_rz_num>0 && ($rzid=='identity' || $rzid=='photo'))?" ,rz_num=rz_num-1":"";
					$db->query("UPDATE ".__TBL_USER__." SET RZ='$RZ' ".$SQL." WHERE id=".$uid);
					AddLog('【认证审核】用户【'.$data_nickname.'（uid:'.$uid.'）】->【'.RZtitle($rzid).'】->驳回');

					$db->query("DELETE FROM ".__TBL_RZ__." WHERE id=".$id);
					@up_send_admindel($path_b.'|'.$path_b2);

					//站内消息
					$C = '请检查('.RZtitle($rzid).')证件或认证资料是否有效';
					$C .= "　<a href=".a('{"kind":"cert","mp":"p"}')." class=aQING target=_blank>重新认证</a>";
					$db->SendTip($uid,'对不起！'.RZtitle($rzid).'审核失败！',dataIO($C,'in'),'sys');
					
					//微信模版
					if (!empty($data_openid) && $data_subscribe==1){
						//审核通过提醒
						$keyword1 = urlencode(RZtitle($rzid));
						$keyword2 = urlencode('未通过');
						$remark   = urlencode('请检查('.RZtitle($rzid).')证件或内容是否有效');
						$url      = urlencode(a('{"kind":"cert","mp":"m"}'));
						@wx_mb_sent('mbbh=ZEAI_HONOR_CHECK&openid='.$data_openid.'&flag=0&keyword1='.$keyword1.'&keyword2='.$keyword2.'&first='.$first.'&remark='.$remark.'&url='.$url);
					}
				}
			}
		}
		json_exit(array('flag'=>1,'msg'=>'驳回成功'));
	break;
}
require_once ZEAI.'cache/udata.php';
$extifshow = json_decode($_UDATA['extifshow'],true);
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="<?php echo HOST;?>/res/www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<link href="css/main.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css">
</head>
<style>
.noU58{position:relative}
.noU58 span{display:block;width:100%;line-height:24px;position:absolute;top:17px;background-color:rgba(0,0,0,0.4);color:#ccc;font-size:12px}
.myinfobfb0,.myinfobfb1,.myinfobfb2{font-family:Arial;font-size:18px;display:block;height:20px;line-height:24px}
.myinfobfb0{color:#999}
.myinfobfb1{color:#f70}
.myinfobfb2{color:#090}
.flagbox i,.flagboxed i{font-size:24px;color:#f00}
.flagbox font,.flagboxed font{display:block;color:#f00}
.flagboxed i{color:#45c01a;}
.flagboxed font{color:#45c01a;}
.rztitle{display:block;width:70px;line-height:24px;color:#fff;margin-top:10px;border-radius:20px;position:relative}
.rztitle i{position:absolute;right:-18px;top:0;font-size:24px;background-color:#fff;border-radius:24px}
.rzlibox {color:#aaa;line-height:60px;height:50px;mragin:5px 0 0 0;border-top:#fff 1px solid}
.rzlibox a{color:#999;margin:0 15px;font-size:14px}
.rzlibox a.ed{color:#FF5722;border-bottom:2px #FF5722 solid;padding-bottom:5px}
.box{min-width:1300px}
</style>
<body>
<div class="box">
	<div class="boxL">
        <a href="cert.php"<?php echo ($f != 'f0')?' class="ed"':'';?>>用户认证列表<?php echo '<b>'.$db->COUNT(__TBL_RZ__).'</b>';?></a>
        <a href="cert.php?f=f0"<?php echo ($f == 'f0')?' class="ed"':'';?>>用户未审失败<?php echo '<b>'.$db->COUNT(__TBL_RZ__,"flag=0").'</b>';?></a>
        <div class="br W80_"></div>
        <a href="cert_auto.php?t=identity">在线实名核验</a>
        <a href="cert_auto.php?t=photo">在线真人比对</a>
	</div>
	<div class="boxR">
        <div class="topsearch">
            <form id="Zeai_search_form" method="get" action="<?php echo SELF; ?>">
                <input name="Skeyword" type="text" id="Skeyword" size="30" maxlength="25" class="input size2" placeholder="输入：UID/用户名/手机/姓名/昵称">
                <input type="hidden" name="p" value="<?php echo $p;?>" />
                <button type="submit" class="btn size2"><i class="ico">&#xe6c4;</i> 搜索</button>
            </form>
            <div class="brbox">
                <?php
                if (count($rz_data) >= 1 && is_array($rz_data)){
					$rscls=(empty($rzid))?' class="ed"':'';
                    echo '<a href="cert.php"'.$rscls.'>全部认证</a>';
                    foreach ($rz_data as $V) {
                        $cls=($rzid==$V)?' class="ed"':'';
                        echo '<a href="cert.php?rzid='.$V.'"'.$cls.'>'.rz_data_info($V,'title').'</a>';
                    }
                }
                ?>
            </div>
		</div>
        <?php
        $SQL = "";
        $Skeyword = trimhtml($Skeyword);
        if (ifint($Skeyword)){
            $SQL = " AND (b.id=$Skeyword) ";
        }elseif(!empty($Skeyword)){
            $SQL = " AND ( ( b.uname LIKE '%".$Skeyword."%' ) OR ( b.nickname LIKE '%".$Skeyword."%' ) OR ( b.nickname LIKE '%".urlencode($Skeyword)."%' ) )";
        }
        if (!empty($rzid))$SQL = " AND a.rzid='$rzid'";
        if ($f=='f0')$SQL = " AND a.flag=0";
        
        $fieldlist  = "a.*,b.uname,b.nickname,b.sex,b.grade,b.love,b.pay,b.mob,b.photo_s,b.photo_f,b.birthday,b.area2title,b.house,b.car,b.edu,b.RZ,b.truename,b.identitynum,b.weixin";
        $rt = $db->query("SELECT ".$fieldlist." FROM ".__TBL_RZ__." a ,".__TBL_USER__." b WHERE a.uid=b.id ".$SQL." ORDER BY a.addtime DESC LIMIT ".$_ADM['admLimit']);
        $total = $db->num_rows($rt);
        if ($total <= 0 ) {
            echo "<div class='nodataico'><i></i>暂无信息<br><a class='aQINGed' href='javascript:history.back(-1)'>返回</a></div>";
        } else {
            $page_skin=2;$pagemode=3;$pagesize=$_ADM['admPageSize'];require_once ZEAI.'sub/page.php';
        ?>
            <form id="www_zeai_cn_FORM">
            <table class="tablelist">
            <tr>
            <th width="20"><input type="checkbox" id="checkboxall1" class="checkskin checkboxall"><label for="checkboxall1" class="checkskin-label"><i class="i1"></i></label></th>
            <th width="70" align="left">UID</th>
            <th width="70" align="left">头像</th>
            <th width="160">认证会员</th>
            <th width="100" align="center">认证状态/项目</th>
            <th width="10" align="center">&nbsp;</th>
            <th width="188" align="left">主表正式资料</th>
            <th align="left" >用户自助提交的资料</th>
            <th width="140" align="center" >时间/备注</th>
            <th align="center" >操作</th>
            </tr>
            <?php
            for($i=1;$i<=$pagesize;$i++) {
                $rows = $db->fetch_array($rt,'name');
                if(!$rows) break;
                $id = $rows['id'];$uid = $rows['uid'];
                $uname = strip_tags($rows['uname']);
                $uname = str_replace($Skeyword,"<font color=red><b>".$Skeyword."</b></font>",$uname);
                $nickname = dataIO($rows['nickname'],'out');
                $nickname = str_replace($Skeyword,"<font color=red><b>".$Skeyword."</b></font>",$nickname);
                $sex       = $rows['sex'];
                $grade     = $rows['grade'];
                $RZ        = $rows['RZ'];
                $rzid      = $rows['rzid'];
                $birthday  = $rows['birthday'];
                $love      = $rows['love'];
                $areatitle = $rows['area2title'];
                $pay       = $rows['pay'];
                $house     = $rows['house'];
                $car       = $rows['car'];
                $edu       = $rows['edu'];
                $flag      = $rows['flag'];
                $path_b    = $rows['path_b'];
                $path_b2   = $rows['path_b2'];
                $ifadm     = $rows['ifadm'];
                $bz        = dataIO($rows['bz'],'out');
                $truename   = trimhtml(dataIO($rows['truename'],'out'));
                $identitynum= trimhtml(dataIO($rows['identitynum'],'out'));
                $weixin= trimhtml(dataIO($rows['weixin'],'out'));
                $content= trimhtml(dataIO($rows['content'],'out'));
                if(empty($rows['nickname'])){
                    $nickname = $uname;
                }
                $addtime = YmdHis($rows['addtime']);
                $photo_s = $rows['photo_s'];
                $photo_f = $rows['photo_f'];
                if(!empty($photo_s)){
                    $photo_s_url = $_ZEAI['up2'].'/'.$photo_s;
                    $photo_s_str = '<img src="'.$photo_s_url.'">';
                }else{
                    $photo_s_str = '';
                    $photo_s_url = '';
                }
                if(!empty($path_b)){
                    $path_b_url = $_ZEAI['up2'].'/'.$path_b;
                    $path_b_str = '<img src="'.$path_b_url.'">';
                }else{
                    $path_b_url = '';
                    $path_b_str = '无图';
                }
                if(!empty($path_b2)){
                    $path_b2_url = $_ZEAI['up2'].'/'.$path_b2;
                    $path_b2_str = '<img src="'.$path_b2_url.'">';
                }else{
                    $path_b2_url = '';
                    $path_b2_str = '无图';
                }
                $mob = strip_tags($rows['mob']);
                $mob = str_replace($Skeyword,"<font color=red><b>".$Skeyword."</b></font>",$mob);
                $photo_fstr = ($photo_f == 0 && !empty($photo_s))?'<span>审核中</span>':'';
                $title2 = (!empty($nickname))?urlencode(trimhtml($nickname).'/'.$uid):$uid;
            ?>
            <tr id="tr<?php echo $id;?>">
              <td width="20" height="40"><input type="checkbox" name="list[]" value="<?php echo $id; ?>" uid="<?php echo $uid; ?>" id="id<?php echo $id; ?>" class="checkskin"><label for="id<?php echo $id; ?>" class="checkskin-label"><i class="i1"></i></label>
              </td>
                <td width="70" align="left" class="C999"><label for="id<?php echo $id; ?>"><?php echo $uid;?></label></td>
                <td width="70" align="left">
                    <a href="javascript:;" class="noU58 sex<?php echo $sex; ?>" onClick="crm_homepage({uid:<?php echo $uid;?>,title2:'<?php echo $title2;?>',photo_s_url:'<?php echo $photo_s_url;?>'});"><?php echo $photo_s_str; ?><?php echo $photo_fstr; ?></a>
                </td>
              <td width="160" align="left" class="lineH150" style="padding:10px 0" onClick="crm_homepage({uid:<?php echo $uid;?>,title2:'<?php echo $title2;?>',photo_s_url:'<?php echo $photo_s_url;?>'});">
                <div style="margin:5px 15px 5px 0"><?php echo RZ_html($RZ,'s','allcolor');?></div>
                
                <?php echo uicon($sex.$grade) ?><?php if(!empty($rows['uname']))echo '<font>'.$uname.'</font></br>';?>
                <font class="uleft">
                <?php
                if(!empty($rows['mob']))echo $mob."</br>";
                if(!empty($rows['nickname']))echo $nickname;?>
                </font>
                
            </td>
            <td width="100" align="center" class="lineH150">
                <div class="<?php echo ($flag == 1)?'flagboxed':'flagbox';?>">
                <?php if ($flag == 1){
                    $icoo="<i class='ico'>&#xe67f;</i><font>审核通过</font>";
                } else {
                    $icoo="<i class='ico'>&#xe65b;</i><font>未审或失败</font>";
                }
                echo $icoo;
                ?>
                </div>
                <div class="rztitle" style="background-color:<?php echo rz_data_info($rzid,'color2');?>"><?php echo RZtitle($rzid);?></div>
            </td>
            <td width="10" align="center" class="C999">&nbsp;</td>
            <td width="188" align="left" class="blue lineH150">
        <?php 
        switch ($rzid){
            case 'identity':
                echo '<font class="C999">姓　名：</font>'.$truename.'<br>';
                echo '<font class="C999">生　日：</font>'.$birthday.'<br>';
                echo '<font class="C999">身份证：</font>'.$identitynum.'<br>';
                //echo '<font class="C999">户籍地：</font>'.$areatitle;
            break;
            case 'photo':
                echo '<font class="C999">姓　名：</font>'.$truename.'<br>';
                echo '<font class="C999">生　日：</font>'.$birthday.'<br>';
                echo '<font class="C999">身份证：</font>'.$identitynum.'<br>';
                //echo '<font class="C999">户籍地：</font>'.$areatitle;
            break;
            case 'edu':
                echo'<font class="C999">学历：</font>'.udata('edu',$edu);
            break;
            case 'car':
                echo '<font class="C999">汽车：</font>'.udata('car',$car);
            break;
            case 'house':
                echo'<font class="C999">房产：</font>'.udata('house',$house);
            break;
            case 'love':
                echo'<font class="C999">婚况：</font>'.udata('love',$love);
            break;
            case 'pay':
                echo'<font class="C999">月收入：</font>'.udata('pay',$pay);
            break;
            case 'weixin':
                echo'<font class="C999">微信：</font>'.$weixin;
            break;
        }
        ?>
            </td>
            <td align="left" class="C999  padding10">
            <?php if(!empty($path_b)){?><a href="javascript:;" onClick="parent.piczoom('<?php echo $path_b_url; ?>');" class="pic50 FL" style="margin:0 10px 0 0"><?php echo $path_b_str; ?></a><?php }?>
            <?php if(!empty($path_b2)){?><a href="javascript:;" onClick="parent.piczoom('<?php echo $path_b2_url; ?>');" class="pic50 FL" style="margin:0 10px 0 0"><?php echo $path_b2_str; ?></a><?php }
			if($rzid=='identity' || $rzid=='photo'){
				$row_shalou=shalou_data($uid);
				$birthday = getSFZbirthday($row_shalou['identitynum']);
				$birthday = str_replace("--","",$birthday);
				$OUT = "";
				if(!empty($row_shalou['truename'])){
					$OUT .= '<div class="blue"><font class="C999">姓　名：</font>'.dataIO($row_shalou['truename'],'out').'</div>';
				}
				if(!empty($birthday)){
					$OUT .= '<div class="blue"><font class="C999">生　日：</font>'.$birthday.'</div>';
				}
				if(ifsfz($row_shalou['identitynum'])){
					$OUT .= '<div class="blue"><font class="C999">身份证：</font>'.dataIO($row_shalou['identitynum'],'out').'</div>';
				}
				echo $OUT;
			}elseif($rzid=='weixin'){
				echo '<div class="blue"><font class="C999">微信：</font>'.$content.'</div>';
			}
			?>
            </td>
            <td width="140" align="center" class="C666 lineH150 padding15"><?php echo $addtime; 
            if(!empty($ifadm)){
                echo '<div class="linebox"><div class="line"></div><div class="title BAI">后台操作</div></div>';
                echo '操作人：'.$ifadm;
            }
            if(!empty($bz)){
                echo '<br>备注：'.$bz;
            }
            ?></td>
            <td align="center">
              <?php if ($flag == 0){?><div><a href="javascript:;" title="审核" class="btn size2 flag1" id="<?php echo $id; ?>" nickname="<?php echo urlencode($nickname);?>" style="margin:5px 0">通过</a></div>
              <div><a href="javascript:;" title="拒绝" class="btn size2 HUI flag0" id="<?php echo $id; ?>" nickname="<?php echo urlencode($nickname);?>" style="margin:5px 0">驳回</a></div><?php }?>
              <a href="javascript:;" photo_s_url="<?php echo $photo_s_url;?>" title2="<?php echo $title2;?>" title="修改" class="btn size2 BAI submod" uid="<?php echo $uid; ?>" style="margin:5px 0">修改</a></td>
            </tr>
            <?php } ?>
        </table>
        <input type="hidden" name="submitok" id="submitok" value="" />
        </form>
        <?php }?>
	</div>
    <div class="clear"></div>
</div>



<?php if ($total > 0 ) {?>
<div class="listbottombox">
	<input type="checkbox" id="checkboxall2" class="checkskin checkboxall"><label for="checkboxall2" class="checkskin-label"><i class="i1"></i></label>　
    <button type="button" id="btndellist" class="btn size2 HEI2 disabled action">批量驳回</button>　
    <button type="button" id="btnflaglist" class="btn size2 LV disabled action">批量通过</button>　
    <button type="button" id="btnsend" value="" class="btn size2 disabled action" onClick="sendTipFn2(this);"><i class="ico">&#xe676;</i> 发送消息</button>
	<?php if ($total > $pagesize)echo '<div class="pagebox FR">'.$pagelist.'</div>'; ?>
</div>

<script>
var bg = '<?php echo $_Style['list_bg']; ?>',overbg   = '<?php echo $_Style['list_overbg']; ?>',selectbg = '<?php echo $_Style['list_selectbg']; ?>';
o('btndellist').onclick = function() {
	allList({
		btnobj:this,
		url:'cert'+zeai.ajxext+'submitok=flag0',
		title:'批量驳回',
		msg:'驳回处理中...',
		ifjson:true,
		ifconfirm:true
	});	
}
zeai.listEach('.flag0',function(obj){
	obj.onclick = function(){
		var id = parseInt(obj.getAttribute("id")),nickname=obj.getAttribute("nickname");
		zeai.confirm('真的要驳回【'+decodeURIComponent(nickname)+'】么？',function(){
			zeai.msg('正在驳回处理...',{time:300});
			zeai.ajax('cert'+zeai.ajxext+'submitok=flag0&list[]='+id,function(e){var rs=zeai.jsoneval(e);
				if (rs.flag == 1){location.reload(true);}else{zeai.msg(0);zeai.msg(rs.msg,{time:1});}
			});
		});
	}
});
o('btnflaglist').onclick = function() {
	allList({
		btnobj:this,
		url:'cert'+zeai.ajxext+'submitok=flag1',
		title:'批量审核',
		content:'<br>请不要关闭窗口耐心等待。',
		msg:'审核处理中...',
		ifjson:true,
		ifconfirm:true
	});	
}
zeai.listEach('.flag1',function(obj){
	obj.onclick = function(){
		zeai.confirm('真的要通过审核么？此操将覆盖主表正式资料',function(){
			var id = parseInt(obj.getAttribute("id")),nickname=obj.getAttribute("nickname");
			zeai.msg('正在审核处理【'+decodeURIComponent(nickname)+'】',{time:300});
			zeai.ajax('cert'+zeai.ajxext+'submitok=flag1&list[]='+id,function(e){var rs=zeai.jsoneval(e);
				if (rs.flag == 1){location.reload(true);}else{zeai.msg(0);zeai.msg(rs.msg,{time:1});}
			});
		});
	}
});
zeai.listEach('.submod',function(obj){
	obj.onclick = function(){
		var uid = parseInt(obj.getAttribute("uid")),
		title2 = obj.getAttribute("title2"),
		//photo_s_url = decodeURIComponent(obj.getAttribute("photo_s_url")),
		urlpre = 'crm_gj_yj.php?uid='+uid+'&submitok=';
		//photo_s_iframe = '<img src="'+photo_s_url+'" class="photo_s_iframe">';
		//zeai.iframe('【'+decodeURIComponent(title2)+'】修改认证资料','u_mod_data.php?t=6&iframenav=1&submitok=mod&ifmini=1&uid='+uid);
		zeai.iframe('【'+decodeURIComponent(title2)+'】强制点亮图标','cert_hand.php?submitok=show&memberid='+uid);
	}
});

</script>
<script src="js/zeai_tablelist.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<?php }?>
<?php require_once 'bottomadm.php';?>